home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / ICONX_FO / OVALUE.C < prev    next >
Text File  |  1990-03-02  |  1KB  |  79 lines

  1. /*
  2.  * File: ovalue.c
  3.  *  Contents: nonnull, null, value
  4.  */
  5.  
  6. #include "::h:config.h"
  7. #include "::h:rt.h"
  8. #include "rproto.h"
  9.  
  10. #ifdef PreProcess
  11. /* include(../M4/ops.m4) /* */
  12. /* */
  13. #endif                    /* PreProcess */
  14.  
  15. /*
  16.  * \x - test x for nonnull value.
  17.  */
  18.  
  19. #ifdef WATERLOO_C_V3_0
  20. struct b_iproc Bnonnull = {
  21.     T_Proc,
  22.     Vsizeof(struct b_proc),
  23.     Ononnull,
  24.     1,
  25.     -1,
  26.     0,
  27.     0,
  28.     {sizeof(BackSlash)-1,BackSlash}}; Ononnull(cargp,sptr) register dptr cargp;
  29. #else                    /* WATERLOO_C_V3_0 */
  30. OpDcl(nonnull,1,BackSlash)
  31. #endif                    /* WATERLOO_C_V3_0 */
  32.    {
  33.  
  34.    /*
  35.     * If Arg1 is not null, it is returned, otherwise, the function fails.
  36.     *  Because the pre-dereference value of Arg1 is the return value (if
  37.     *  any), Arg1 is copied into Arg0.
  38.     */
  39.    Arg0 = Arg1;
  40.    if (DeRef(Arg1) == Error) 
  41.       RunErr(0, NULL);
  42.    if (ChkNull(Arg1))
  43.       Fail;
  44.    Return;
  45.    }
  46.  
  47. /*
  48.  * /x - test x for null value.
  49.  */
  50.  
  51. OpDcl(null,1,"/")
  52.    {
  53.  
  54.    /*
  55.     * If Arg1 is null, it is returned, otherwise, the function fails.
  56.     *  Because the pre-dereference value of Arg1 is the return value (if
  57.     *  any), Arg1 is copied into Arg0.
  58.     */
  59.    Arg0 = Arg1;
  60.    if (DeRef(Arg1) == Error) 
  61.       RunErr(0, NULL);
  62.    if (!ChkNull(Arg1))
  63.       Fail;
  64.    Return;
  65.    }
  66.  
  67. /*
  68.  * .x - produce value of x.
  69.  */
  70.  
  71. OpDcl(value,1,".")
  72.    {
  73.  
  74.    if (DeRef(Arg1) == Error) 
  75.       RunErr(0, NULL);
  76.    Arg0 = Arg1;
  77.    Return;
  78.    }
  79.